package cn.tedu.boot04.mapper;

import cn.tedu.boot04.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/5/11 16:07
 * @Package 包名：cn.tedu.boot04.mapper
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
@Mapper
public interface ProductMapper {
	@Insert("INSERT INTO product VALUES(NULL,#{title},#{price},#{num})")
	void insert(Product product);

	@Select("SELECT * FROM product")
	List<Product> select();

	@Delete("DELETE FROM product WHERE id=#{id}")
	void deleteById(int id);

	@Update("UPDATE product SET title=#{title},price=#{price},num=#{num} WHERE id=#{id}")
	void update(Product product);

}